package security

import (
	"encoding/hex"
	"github.com/emmansun/gmsm/sm3"
)

func EncryptSM3(data string) string {
	sum := sm3.Sum([]byte(data))
	return hex.EncodeToString(sum[:])
}

func VerifySM3(data, hash string) bool {
	sum := sm3.Sum([]byte(data))
	return hex.EncodeToString(sum[:]) == hash
}
